# 提取字符串数字并求和
def get_digit(ste):
    strNum = []
    for item in ste:
        if item.isdigit():
            strNum.append(item)
    return sum(strNum)


# 实现字符串中字符大小写转换
def lower_upper(str, isBold=True):
    lst = []
    for item in str:
        if 'A' <= item <= 'Z' and isBold:
            lst.append(chr(ord(item) + 32))
        elif 'a' <= item <= 'z' and not isBold:
            lst.append(chr(ord(item) - 32))
        else:
            lst.append(item)
    return ''.join(lst)


if __name__ == '__main__':
    str = input("请输入一串字符：")
    print('对字符中数字进行计算总和', get_digit(str))
    print('对字符中大小写转换，数字不变', lower_upper(str))

    print(3<<1)

